﻿using System.Diagnostics;
using System.Reflection;
using System.Windows;
using Microsoft.VisualStudio.PlatformUI;
using AppRes = WindowsPhoneCommands.Resources;

// ReSharper disable CheckNamespace
namespace WindowsPhoneCommands
// ReSharper restore CheckNamespace
{
    /// <summary>
    /// Interaction logic for CreateLoginDialog.xaml
    /// </summary>
    public partial class AboutDialog : DialogWindow
    {

        public AboutDialog()
        {
            InitializeComponent();

        }

        private void WindowLoaded(object sender, RoutedEventArgs e)
        {
            Background = VsTheming.GetDialogBackground();

            Version.Text = AppRes.Version + " " +  Assembly.GetExecutingAssembly().GetName().Version;

            Title = AppRes.ToolWindowTitle + " " + AppRes.XHelp;

        }

        private void OkButtonClick(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void TextBlockMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            Process.Start("http://wphonecommands.codeplex.com");
        }

        private void ImageMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            Process.Start("http://devphonetoolkit.codeplex.com/");
        }

        private void HyperlinkRequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
        {
            Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
            e.Handled = true;
        }
    }
}